public class Client {
    public static void main(String[] args) {
        GameRole gameRole1 = new GameRole("小米",100, 120);
        GameRole gameRole2 = new GameRole("小弘",130, 110);

        Caretaker caretaker = new Caretaker();
        caretaker.setMemento(gameRole1.getName(),gameRole1.createMemento());
        caretaker.setMemento(gameRole2.getName(),gameRole2.createMemento());


        gameRole1.display();
        System.out.println("和boss大战后-------");
        gameRole1.setVit(50);
        gameRole1.setDef(60);
        gameRole1.display();


        System.out.println("恢复中-----");
        gameRole1.backFromMemento(caretaker.getMemento(gameRole1.getName()));
        gameRole1.display();


    }
}
